package io.github.burukeyou.dataframe.iframe.group;

import java9.util.function.Function;

/**
 * @author caizhihao
 * @param <T>
 */
public class GroupConcatImpl<T> implements GroupConcat<T> {

    private Function<T, ?> aggField;

    private CharSequence delimiter = ",";

    private CharSequence prefix = "";

    private CharSequence suffix = "";

    public GroupConcatImpl(Function<T, ?> aggField, CharSequence delimiter) {
        this.aggField = aggField;
        this.delimiter = delimiter;
    }

    public GroupConcatImpl(Function<T, ?> aggField, CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
        this.aggField = aggField;
        this.delimiter = delimiter;
        this.prefix = prefix;
        this.suffix = suffix;
    }

    public Function<T, ?> getAggField() {
        return aggField;
    }

    public void setAggField(Function<T, ?> aggField) {
        this.aggField = aggField;
    }

    public CharSequence getDelimiter() {
        return delimiter;
    }

    public void setDelimiter(CharSequence delimiter) {
        this.delimiter = delimiter;
    }

    public CharSequence getPrefix() {
        return prefix;
    }

    public void setPrefix(CharSequence prefix) {
        this.prefix = prefix;
    }

    public CharSequence getSuffix() {
        return suffix;
    }

    public void setSuffix(CharSequence suffix) {
        this.suffix = suffix;
    }
}
